<?php
#定义常量
define('ROOT',realpath(dirname(__FILE__).'/../').'/');
define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());

#环境设置
ini_set('date.timezone','Asia/Shanghai');
ini_set('display_errors','on');
error_reporting(E_ALL);
set_include_path(get_include_path() . PATH_SEPARATOR . ROOT.'libs/');


#引入文件
require_once ROOT . 'conf/db.config.php';
require_once ROOT . 'libs/core.php';
require_once ROOT . 'libs/base.php';
require_once ROOT . 'libs/error.php';
require_once ROOT . 'libs/functions.php';
require_once ROOT . 'libs/Zend/Registry.php';
require_once ROOT . 'libs/Zend/Db/Table.php';
require_once ROOT . 'libs/table.php';
require_once ROOT . 'libs/ChineseSpell.class.php';

require_once ROOT . 'app/model/user.lib.php';
#require_once ROOT . 'libs/Zend/Acl.php';
#require_once ROOT . 'libs/Zend/Acl/Role.php';

#安全设置
#note 清除变量
unset($GLOBALS, $_ENV, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_ENV_VARS);
#过滤变量
$_GET     = daddslashes($_GET, 1, TRUE);
$_POST    = daddslashes($_POST, 1, TRUE);
$_COOKIE  = daddslashes($_COOKIE, 1, TRUE);
$_SERVER  = daddslashes($_SERVER);
$_FILES   = daddslashes($_FILES);
$_REQUEST = $request = daddslashes($_REQUEST, 1, TRUE);

#注册变量
Zend_Registry::set('config',$config);

#定义常用URL
#define('MAKE_INDEX','inddex.php?m=system&a=makeindex');

#权限设置
#$acl	= new Zend_Acl();
#$acl->addRole(new Zend_Acl_Role('guess'));
#$acl->addRole(new Zend_Acl_Role('staff'), 'guest');
#$acl->addRole(new Zend_Acl_Role('editor'), 'staff');
#$acl->addRole(new Zend_Acl_Role('administrator'));
